package com.enjoyireland.hiking;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.MenuItem;
import android.view.View;

/**
 * Activity to Host Tab fragments
 * 
 * @author Rónan Mac an tSaoir
 *
 */
public class WalkTabs extends FragmentActivity{

	WalkView view;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tabs);
        
    }
    
    @Override
	public boolean onMenuItemSelected(int id, MenuItem item){
    	view = (WalkView)getSupportFragmentManager().findFragmentById(R.id.mapTab);
		switch(item.getItemId()){
			case 0: return view.onNavigateSelected(item);
		}
		return false;
    }
    
	public void startNavigating(View v){
		view = ((WalkView)getSupportFragmentManager().findFragmentById(R.id.mapTab));
		view.startNavigating(view.getView());
	}
    
}
